<?php
/**
* Template designed by 12leaves.com
* 12leaves.com - Free ecommerce templates and design services
*
 * Page Template
 *
 * Loaded automatically by index.php?main_page=product_info.<br />
 * Displays details of a typical product
 *
 * @package templateSystem
 * @copyright Copyright 2003-2006 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: tpl_product_info_display.php 5369 2006-12-23 10:55:52Z drbyte $
 */
 //require(DIR_WS_MODULES . '/debug_blocks/product_info_prices.php');
?>
<div class="centerColumn" id="productGeneral">

<!--bof Product Name-->
<!--  <h1 id="productName" class="productGeneral"><?php echo $products_name; ?></h1>-->
<!--eof Product Name-->

<!--bof Form start-->
<?php echo zen_draw_form('cart_quantity', zen_href_link(zen_get_info_page($_GET['products_id']), zen_get_all_get_params(array('action')) . 'action=add_product', $request_type), 'post', 'enctype="multipart/form-data"') . "\n"; ?>
<!--eof Form start-->

<?php if ($messageStack->size('product_info') > 0) echo $messageStack->output('product_info'); ?>

<!--bof Category Icon -->
<?php if ($module_show_categories != 0) {?>
<?php
/**
 * display the category icons
 */
require($template->get_template_dir('/tpl_modules_category_icon_display.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_category_icon_display.php'); ?>
<?php } ?>
<!--eof Category Icon -->

<!--bof Prev/Next top position -->
<?php if (PRODUCT_INFO_PREVIOUS_NEXT == 1 or PRODUCT_INFO_PREVIOUS_NEXT == 3) { ?>
<?php
/**
 * display the product previous/next helper
 */
//require($template->get_template_dir('/tpl_products_next_previous.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_products_next_previous.php'); ?>
<?php } ?>
<!--eof Prev/Next top position-->

<!--bof Main Product Image -->
<?php
  if (zen_not_null($products_image)) {
  ?>
<?php
/**
 * display the main product image
 */
   require($template->get_template_dir('/tpl_modules_main_product_image.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_main_product_image.php'); ?>
<?php
  }
?>
<!--eof Main Product Image-->

<!-- start attrib -->



<div class="shop_attrib">

     
<div class="attrib"><!-- start rib -->

<div class="buying_info">
                    	<div class="main">
                        	<h2><?php echo $products_name; ?></h2>
<table width="100%" border="0" class="info_tag">
  <tr>
    <td width="40">款号：</td>
    <td><?php echo $products_model;?></td>
  </tr>
  <tr>
    <td>现价：</td>
    <?php 
    $price = zen_get_products_display_price_main((int)$_GET['products_id']);
    
    if($price["special_price"]!="")
        $display_price = $price["special_price"];
    else
        $display_price = $price["normal_price"];
    
    ?>
    <td><sup>¥</sup><span class="price"><?php echo $display_price;?></span><span>/套</span></td>
  </tr>
  
  <tr>
    <td>数量：</td>
    <td>
    	

<!--bof Add to Cart Box -->
<?php
if (CUSTOMERS_APPROVAL == 3 and TEXT_LOGIN_FOR_PRICE_BUTTON_REPLACE_SHOWROOM == '') {
  // do nothing
} else {
?>
            <?php
    $display_qty = (($flag_show_product_info_in_cart_qty == 1 and $_SESSION['cart']->in_cart($_GET['products_id'])) ? '<p>' . PRODUCTS_ORDER_QTY_TEXT_IN_CART . $_SESSION['cart']->get_quantity($_GET['products_id']) . '</p>' : '');
            if ($products_qty_box_status == 0 or $products_quantity_order_max== 1) {
              // hide the quantity box and default to 1
              $the_button = '<input type="hidden" name="cart_quantity" value="1" />' . zen_draw_hidden_field('products_id', (int)$_GET['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT);
            } else {
              // show the quantity box    购买数量
    
                 $qry = zen_get_buy_now_qty($_GET['products_id']);
   
                $the_button = '<select name="cart_quantity">
        	<option>'.$qry.'</option>
        	<option>2</option>
        	<option>3</option>
        	<option>4</option>
        	<option>5</option>
        	<option>6</option>
        	<option>7</option>
        	<option>8</option>
        	<option>9</option>
        	<option>10</option>
        </select>
        ';
            }
    $display_button = zen_get_buy_now_button($_GET['products_id'], $the_button);
  ?>
  <?php if ($display_qty != '' or $display_button != '') { ?>
  
   
  <?php } // display qty and button ?>
<?php } // CUSTOMERS_APPROVAL == 3 ?>
<!--eof Add to Cart Box-->
                   
  <?php 
  echo $the_button;
  echo zen_draw_hidden_field('products_id', (int)$_GET['products_id']) ; //多这个就可以了！
                        
  ?>
    </td>     
  </tr>
  
  <tr><td colspan="2">
  <!--bof Attributes Module -->
<?php
  if ($pr_attr->fields['total'] > 0) {
?>
<?php
/**
 * display the product atributes
 */
  require($template->get_template_dir('/tpl_modules_attributes.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_attributes.php'); ?>
<?php
  }
?>
<!--eof Attributes Module -->
  
  </td></tr>
  <tr><td></td></tr>
 </table>	
 <div style="display:none;">
     <?php echo zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT,'class="btn_add" id="submitadd"');?>
 </div>
                    <a class="btn_add" href="javascript:onsubmitthis();">
                            	放入购物车
                            </a> 
                          
                        </div>
                        <div class="bottom"></div>
                    </div>
           
</div>

</div>	
<!-- end shop_attrib -->

<!--bof Additional Product Images -->
<?php
/**
 * display the products additional images
 */
  //require($template->get_template_dir('/tpl_modules_additional_images.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_additional_images.php'); ?>


<div id="show_product_add_img">
    		<div id="Contain" class="main_pic_style">
    			<img id="BigImage" src="<?php echo $products_image_medium ;?>" />
    		</div>
    		<div id="SmallImg" class="small_pic_style">
    			<?php
    		    require($template->get_template_dir('/tpl_modules_additional_images.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_additional_images.php');
    			?>
    		</div>
		</div>
<!--eof Additional Product Images -->


 <!--bof Product description -->
<?php if ($products_description != '') { ?>
<div id="productDescription" class="productGeneral biggerText back"><?php echo stripslashes($products_description); ?></div>
<?php } ?>
<!--eof Product description -->
<br class="clearBoth" />


<!--bof Form close-->
</form>
<!--bof Form close-->
</div>

<script type="text/javascript">
function onsubmitthis(){
	$("#submitadd").click();
	
}
</script>